<div class="container main" ng-controller="VectorListCtrl">
    <!-- 顶部功能区 -->
    <div class="row">
        <div class="panel panel-default">
            <!-- Default panel contents -->
            <div class="panel-heading">
                <div class="text-center"><strong>{[moduleTitle|uppercase]}</strong></div>
                <div class="row">
                    <div class="col-md-4">
                        <span class="btn-group">
                            <button data-toggle="dropdown" class="btn btn-primary dropdown-toggle">
                                <strong>Add</strong>&nbsp;&nbsp;<i class="caret"></i>
                            </button>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="{[VBDOMAIN]}#/design/vector/pLV_Ex" target="_blank">Lentivirus</a>
                                </li>
                                <li>
                                    <a href="{[VBDOMAIN]}#/design/vector/pMXs_Ex" target="_blank">MMLV retrovirus</a>
                                </li>
                                <li>
                                    <a href="{[VBDOMAIN]}#/design/vector/pAV_Ex" target="_blank">Adenovirus</a>
                                </li>
                                <li>
                                    <a href="{[VBDOMAIN]}#/design/vector/pPB_Ex" target="_blank">PiggyBac</a>
                                </li>
                                <li>
                                    <a href="{[VBDOMAIN]}#/design/vector/pRP_Ex" target="_blank">Regular plasmid</a>
                                </li>
                            </ul>
                        </span>
                    </div>

                    <div class="col-md-8">
                        <form name="form_query" ng-submit="query()" class="form-inline pull-right">
                            <div class="form-group">
                                <label class="sr-only"></label>
                                <input type="text" class="form-control" ng-model="parameters.query" placeholder="Keywords" />
                            </div>

                            <div class="form-group">
                                <label class="sr-only"></label>
                                <select class="form-control" name="limit" ng-model="parameters.limit">
                                    <option value="20">20</option>
                                    <option value="30">30</option>
                                    <option value="50">50</option>
                                    <option value="100">100</option>
                                    <option value="0">Unlimited</option>
                                </select>
                            </div>

                            <button type="submit" class="btn btn-info"> <i class="glyphicon glyphicon-search icon-white"></i> Search</button>
                        </form>
                    </div>
                </div>
            </div>

            <!-- Table -->
            <div ng-show="objects.length == 0" class="text-center">
                <p class="fa fa-comment-o">No vector found.</p>
            </div>
            <table class="table table-striped table-bordered table-condensed table-hover" ng-show="objects.length > 0" ts-wrapper>
                <thead>
                    <tr>
                        <th>
                            <select-all-checkbox checkboxes="objects" all-selected="AllSelectedItems"
                            all-clear="NoSelectedItems"></select-all-checkbox>
                        </th>
                        <th ts-criteria="vector_id">Vector Id</th>
                        <th ts-criteria="vector_name">Vector Name</th>
                        <th ts-criteria="unit_price">Unit Price ($)</th>
                        <th ts-criteria="turnaround_time">Turnaround Time (day)</th>
                        <th ts-criteria="created_on">Created On</th>
                        <th ts-criteria="comment">Comment</th>
                        <th></th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="obj in objects" ts-repeat="ts-repeat">
                        <td class="text-center">
                            <input type="checkbox" ng-model="obj.isSelected" />
                        </td>
                        <td class="text-center">
                             <a href="javascript:void(0)" ng-click="openVectorDetail(obj.uuid)">{[ obj.vector_id ]}</a>
                        </td>
                        <td class="text-center"> <a href="{[ obj.url ]}" target="_blank">{[ obj.vector_name ]}</a>
                        </td>
                        <td class="text-center">{[ obj.unit_price ]}</td>
                        <td class="text-center">{[ obj.turnaround_time ]}</td>
                        <td class="text-center">{[ obj.created_on | fixDateTime ]}</td>
                        <td class="text-center">
                            <a href="javascript:void(0)" editable-text="obj.comment" onbeforesave="patchDetail('vector', obj.id, {comment: $data})">
                               {[ obj.comment || 'empty' ]}
                            </a>
                        </td>
                        <td class="text-right">
                            <span class="btn-group">
                                <button data-toggle="dropdown" class="btn btn-primary btn-xs dropdown-toggle">
                                    <strong>Actions</strong>&nbsp;&nbsp;<i class="caret"></i>
                                </button>
                                <ul class="dropdown-menu dropdown-menu-1">
                                    <li class="text-left">
                                        <a ng-click="getMoreInfo('vector',obj.id)" href="javascript:void(0);">More Info</a>
                                    </li>
                                </ul>
                            </span>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
    <div ng-include="'/static/js/views/components/pager.html'" style="display: inline;"></div>

</div>